#Maintainer: Oliver Galvin <odg at riseup dot net>

pkgbase=tubeman
pkgname=( "$pkgbase"{,-gtk} )
pkgver=0.1
pkgrel=1
pkgdesc="Local YouTube subscription manager and browser"
arch=('x86_64' 'i686' 'arm7h')
url="https://notabug.org/odg/$pkgbase"
license=('GPL3')
makedepends=('curl' 'gtk3' 'ncurses' 'sqlite')
source=("${pkgbase}-${pkgver}.tar.gz"::"${url}/archive/${pkgver}.tar.gz"{,.asc})
sha512sums=('3b8f105e49c23b14302131f1be867e4a6c3bcf9622a014762fc1cf4f83075afe011fb20aa7a41dd9c55674b899ef40208f4bb9179f446c18fb02b202b3cc4a2b'
            SKIP)
validpgpkeys=('491E0D9EE7AA9E15D089950A787966257046CC21') #Oliver Galvin

build() {
	cd ${pkgbase}-${pkgver}
	./configure --prefix=/usr
	make
}

package_tubeman() {
	depends=('curl' 'ncurses' 'sqlite')
	optdepends=('w3m: thumbnail support')
	cd ${pkgbase}-${pkgver}/src
	make DESTDIR="$pkgdir" install
}

package_tubeman-gtk() {
	pkgdesc+=" - GTK frontend"
	depends=('gtk3' 'tubeman')
	cd ${pkgbase}-${pkgver}/gtk
	make DESTDIR="$pkgdir" install
}

check() {
	cd ${pkgbase}-${pkgver}
	make check
}
